package com.glela.order.service.impl;

import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.glela.order.mapper.CommisionMapper;
import com.glela.order.model.Commision;
import com.glela.order.service.CommissionService;
import com.glela.order.vo.CommisionUpdateStatusVo;
import com.glela.order.vo.ParamsCommisionVo;

@Service
public class CommissionServiceImpl implements CommissionService {
	@Autowired
	private CommisionMapper commisionMapper;

	@Override
	public List<Commision> queryAll(ParamsCommisionVo queryParams) {
		return commisionMapper.selectByBussinessTypes(queryParams);
	}

	@Override
	public boolean modify(List<CommisionUpdateStatusVo> updateCommission) {
		if (CollectionUtils.isEmpty(updateCommission)) {
			return false;
		}
		return commisionMapper.batchUpdateStatus(updateCommission) == 1;
	}
}